<?php
require_once "maincore.php";
include LOCALE.LOCALESET."print.php";

echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
echo "<html>\n<head>\n";
//echo "<title>".$settings['sitename']."</title>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."' />\n";
echo "<meta name='description' content='".$settings['description']."' />\n";
echo "<meta name='keywords' content='".$settings['keywords']."' />\n";
echo "<style type=\"text/css\">\n";
echo"

/*-------------------------------\
Forest theme style by Frosty
www.morvikveien.com
\------------------------------*/

a {
	color : #005599;
	text-decoration : none;
}

a:hover {
	color : #121624;
	text-decoration : underline;
}

a.side {
	color : #121624;
	text-decoration : none;
}

a:hover.side {
	color : #121624;
	text-decoration : underline;
}

a.white, li.white a {
	color: #121624;
	text-decoration: none;
}

a:hover.white, li.white a:hover {
	color: #121624;
	text-decoration: underline;
}

body {
	font-size: 10pt;
font-family:'Times New Roman',Times,serif;
color:#000000; 
	
	background-color : #ffffff;
	margin: 0px auto;
	

}

form {
	margin : 0px;
}

h1 { 
	color : #000000;
}

li { 
	color : #000000;
}

ul { 
	color : #000000;
}

p { 
	color : #000000;
}

hr {
	height : 1px;
	border : 1px solid #C8AA84;
}

hr.side-hr {
	height : 1px;
	border : 1px solid #eee;
}

th {
	font-size: 10pt;
font-family:'Times New Roman',Times,serif;
color:#000000; 
}
td {
	font-size: 10pt;
font-family:'Times New Roman',Times,serif;
color:#000000; 
}



pre {
	font-size: 10pt;
font-family:'Times New Roman',Times,serif;
color:#000000; 
}

.alt {
	color : #555;
}

.outer-border {
	border : 1px solid 000;
}

P.breakhere {page-break-before: always}


.button {
	font-family : Verdana, Arial, Helvetica, sans-serif;
	font-size : 10px;
	color : #121624;
	background-color : #EFE7DC;
	height : 20px;
	border : 1px solid #ccc;
	margin-top : 2px;
}


.textbox {
	font-family : Verdana, Arial, Helvetica, sans-serif;
	font-size : 10px;
	color : #121624;
	background-color : #EFE7DC;
	border : 1px solid #9A5C00;
}

.main-body {
	font-size : 11px;
	color : #121624;
	background-color : #ffffff;
	background-image: url(../Dimension/images/forum-caption.gif);
	padding : 4px 0px 5px 0px;
}

.center {
	margin : 0 auto;
}

.side-body {
	font-size : 10px;
	color : #121624;
	background-color : #EFE7DC;
    background-image: url(../Dimension/images/forum-caption.gif);
	padding : 4px;
}

.main-bg {
	color : #EFE7DC;
	background-image:url(../Dimension/images/forum-caption.gif);
	background-color : #EFE7DC;
	background-repeat: repeat-g;
}

.border {
	border : 1px solid #9A5C00;
	margin-bottom : 5px;
}

.admin-message {
	font-family : Verdana, Arial, Helvetica, sans-serif;
	font-size : 11px;
	text-align : center;
	color : #121624;
	background-color : #EFE7DC;
	border : 1px solid #B5B5B5;
	padding : 3px 4px 5px 4px;
	margin-bottom : 5px;
}

.side-left .side-border-right {display: none;}
.side-right .side-border-left {display: none;}

.side-border-left {
	color : #121624;
	background-color : #EFE7DC;
    background-image: url(../Dimension/images/forum-caption.gif);
	padding : 10px 0px 10px 10px;
	width: 175px;
}

.side-border-right {
	color : #121624;
	background-color : #EFE7DC;
    background-image: url(../Dimension/images/forum-caption.gif);
	padding : 10px 10px 10px 0px;
	width: 175px;
}

.news-category {
	border:0;
	margin:3px 5px 0 0;
	float:left;
}

.news-footer {
	font-size : 10px;
	color : #121624;
	background-color : #EFE7DC;
	padding : 3px 4px 4px 4px;
}

.capmain {
	font-family : Verdana, Arial, Helvetica, sans-serif;
	font-size : 11px;
	font-weight : bold;
	color : #000000;
	border: solid 1px;	
	margin-left:10px;
	
	
	border-color:#999999;
	
	background-color : #EBEBEB;
    background-image : url(images/scapbg.gif);
	padding : 7px;
	width:630px;
}

.scapmain {
	font-family : Verdana, Arial, Helvetica, sans-serif;
	font-size : 11px;
	font-weight : bold;
	color : #000000;
	background-color : #ffffff;
	background-image : url(images/scapbg.gif);
	border-bottom : 0px solid #9A5C00;
	padding : 7px;
	
}




table.imagetable {
	font-family: verdana,arial,sans-serif;
	font-size:11px;
	color:#333333;
	border: solid 1px;
	border-color: #999999;
	border-collapse: collapse;
	background:#ffffff url('images/cell-grey.jpg');
	width:630px;
	text-transform: capitalize;
	margin-left:10px;
	
}





table.imagetable th {
	background:#F6F6F6 url('images/cell-blue.jpg');
	border-width: 0px;
	padding: 8px;
	width: 50px;
	border-right:solid 1px;
	/*text-align:left;*/
	/*border-bottom:solid 1px;
	border-top: solid 1px;	
	border-right:solid 1px;
	border-left:solid 1px;*/
	border-color: #999999;
	text-transform: capitalize;	
	text-align:left;
		
}



table.imagetable td {
	background:#ffffff url('images/cell-grey.jpg');
	border-width: 0px;
	padding: 8px;
	border-style: solid;
	border-color: #999999;
	text-transform: capitalize;
}






.tbl-border {
	border : 1px solid #9A5C00;
}

.tbl {
	font-size : 11px;
	color : #01010F;
	background-color : #DDCCB4;
	padding : 4px;
}

.tbl1 {
	font-size : 11px;
	color : #121624;
	background-color : #DDCCB4;
    background-image : url(images/scapbg.jpg);
	padding : 4px;
}

.tbl2 {
	font-size : 11px;
	color : #01010D;
	background-color : #EFE7DC;
	padding : 4px;
}

.forum-caption {
	font-size : 11px;
	font-weight : bold;
	color : #121624;
	background-color : #DDCCB4;
	padding : 2px 4px 4px 4px;
}

.quote {
	font-size : 11px;
	color : #121624;
	background-color : #EFE7DC;
	padding : 4px;
	margin : 0px 20px 0px 20px;
	border : 1px solid #bbb;
}

.poll {
	height : 12px;
	border : 1px solid #bbb;
}

.comment-name {
	font-weight : bold;
	color : #01010F;
}

.shoutboxname {
	font-weight : bold;
	color : #01010F;
	background-color : #EFE7DC;
	
	
}

.shoutbox {
    font-weight : bold;
	color : #01010F;
}

.shoutboxdate {
	font-size : 10px;
	color : #01010F;
}

.small {
	font-size : 10px;
	font-weight : normal;
}

.small2 {
	font-size : 10px;
	font-weight : normal;
	color : #ffffff;
}

.side-small {
	font-size : 10px;
	font-weight : normal;
	color : #01010F;
	background-color : #B5B5B5;
}

.side-label {
	color : #01010F;
	background-color : #B5B5B5;
	padding : 2px 2px 3px 2px;
}

/* Vertical Navigation */

#navigation h2 {
	font-size: 10px;
	color : #01010F;
	background-color: #01010F;
	margin: 0;
	padding: 4px;
}
	
#navigation ul {
	margin: 20;
	padding: 0;
	list-style-type: none;
}

* html #navigation ul li{
   height: 1%;
}

#navigation a {
	display: block;
	color: #01010F;
	background-color: #f6f6f6;
	padding: 2px;
	text-decoration : none;
}

#navigation a:hover {
	color: #01010F;
	background-color: #005599;
}

/* Page Navigation */

.pagenav {
	padding: 0.4em;
}

.pagenav span {
	color: #01010F;
	background-color: #005599;
	border: 1px solid #e1e1e1;
	padding: 0.2em 0.4em 0.2em 0.4em;
	margin: 0.2em;
}

.pagenav a {
	color: #01010F;
	background-color: #fff;
	border: 1px solid #e1e1e1;
	padding: 0.2em 0.4em 0.2em 0.4em;
	margin: 0.2em;
	text-decoration: none;
}

.pagenav a:hover {
	color: #01010F;
	background-color: #005599;
	margin: 0.2em;
	text-decoration: none;
}




";

echo "body { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:14px; }\n";
echo "hr { height:1px;color:#ccc; }\n";
echo ".small { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:12px; }\n";
echo ".small2 { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:12px;color:#666; }\n";
echo "</style>\n</head>\n<body>\n";


$avloserid=$_GET['avloserid'];





//Oppkobling mot databasen. Opkoblingsinfo ligger i config.php

$db = mysql_connect($GLOBALS['db_host'], $GLOBALS['db_user'], $GLOBALS['db_password']);
mysql_select_db($GLOBALS['db_name'], $db); 

$query="SELECT type 
		FROM arbeidstype
		WHERE avloserid=".$avloserid."
		AND type LIKE '%avl%'";
		 
$result=mysql_query($query);
$num=mysql_numrows($result);					

$i=0;										
while ($i < $num) 
	{
	$type2=mysql_result($result,$i,"type");
	++$i; //teller økes med 1
	}
		
$query="SELECT type 
		FROM arbeidstype
		WHERE avloserid=".$avloserid."
		AND type LIKE '%admin%'";
		 
$result=mysql_query($query);
$num=mysql_numrows($result);					

$i=0;										
while ($i < $num) 
	{
	$type1=mysql_result($result,$i,"type");
	++$i; //teller økes med 1
	}
	
$query="SELECT type 
		FROM arbeidstype
		WHERE avloserid=".$avloserid."
		AND type LIKE '%annen%'";
		 
$result=mysql_query($query);
$num=mysql_numrows($result);					

$i=0;										
while ($i < $num) 
	{
	$type3=mysql_result($result,$i,"type");
	++$i; //teller økes med 1
	}

$query="SELECT type 
		FROM arbeidstype
		WHERE avloserid=".$avloserid."
		AND type LIKE '%utenlandsk%'";
		 
$result=mysql_query($query);
$num=mysql_numrows($result);					

$i=0;										
while ($i < $num) 
	{
	$type4=mysql_result($result,$i,"type");
	++$i; //teller økes med 1
	}

$query=" SELECT * FROM avloser, postkatalog 
			WHERE avloserid=".$avloserid." 
			AND avloser.postnr = postkatalog.postnr"; 	

$result=mysql_query($query);
$num=mysql_numrows($result);					

$i=0;										
while ($i < $num) 
	{
$fornavn=mysql_result($result,$i,"fornavn");
	$etternavn=mysql_result($result,$i,"etternavn");
	$adresse=mysql_result($result,$i,"adresse");
	$postnr=mysql_result($result,$i,"postnr");
	$telefon=mysql_result($result,$i,"telefon");
	$mobil=mysql_result($result,$i,"mobil");
	$epost=mysql_result($result,$i,"epost");
	$aktiv=mysql_result($result,$i,"aktiv");
	$agronom=mysql_result($result,$i,"agronom");
	$poststed=mysql_result($result,$i,"poststed");
	$parorende=mysql_result($result,$i,"parorendenavn");
	$parorendetlf=mysql_result($result,$i,"parorendetlf");
	++$i; //teller økes med 1
	}
	
//Skriver ut tabellen som persondata skal stå i 


echo "


	<br></br> 
	<table class='capmain' border='0' cellpadding='0'>
		<tr>
			<td><font style='text-transform: capitalize;'>Informasjon om:&nbsp; $fornavn  $etternavn </font></td>
		</tr>
	</table>
	
		<table class='imagetable' border='0' cellpadding='5' tableborder='10'>
		
		<tr>	<th class='b'><b>Etternavn</b></th>		<th class='b' colspan='2'><b>Fornavn</b>	</tr>
		<tr>	<td class='a'>$etternavn</td>			<td class='a' colspan='2'>$fornavn</td>			</tr>
		<tr>	<th class='b'><b>Adresse</b></th>		<th class='b'><b>Postnr</b></th>	<th class='b'><b>Poststed</b></th>	</tr>
		<tr>	<td class='a'>$adresse</td>				<td class='a'>$postnr</td>			<td class='a'>$poststed</td>
					</tr>
		<tr>	<th class='b'><b>Telefon</b></th>    				<th class='b'><b>Mobil</b>	</th><th class='b' ><b>Epost</b></th>	</tr>
		<tr>	<td class='a'>$telefon</td>				<td class='a'>$mobil</td>	<td class='a'>$epost</td>				</tr>
		<tr>	<th class='b'><b>Aktiv</b></th>			<th class='b'><b>Type</b></th>	<th class='b'><b>Agronomutdannet</b></th>	</tr>				
		<tr>	<td class='a'>$aktiv</td>				<td class='a' >";if(isset($type1)){echo"$type1, ";} if(isset($type2)){echo"$type2, ";} if(isset($type3)){echo"$type3, ";} if(isset($type4)){echo"$type4, ";} echo"</td>		<td class='a'>$agronom</td>	</tr>
		<tr>	<th class='b'><b>P&aring;r&oslash;rendenavn</b></th>			<th colspan='2' class='b'><b>P&aring;r&oslash;rendetelefon </b></th>		</tr>
		<tr>	<td class='a'>$parorende</td>				<td colspan='2' class='a' >$parorendetlf</td>			</tr>
		
	
	
	</table>
	";
//Her slutter koden for å hente ut persondata		
//--------------------------------------------------------------------------------------------
	
	
	

//Her begynner funksjonen for kontrakt
//--------------------------------------------------------------------------------------------
$db = mysql_connect($GLOBALS['db_host'], $GLOBALS['db_user'], $GLOBALS['db_password']);
mysql_select_db($GLOBALS['db_name'], $db); 

$query="SELECT * FROM arbeidskontrakt, avloser  
	WHERE avloser.avloserid=$avloserid
	AND avloser.avloserid=arbeidskontrakt.avloserid 
	ORDER BY oppsigelsesdato DESC" ;
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num>0){ 
echo "
	<table class='capmain' border='0' cellpadding='0' >
	<tr><td><font style='text-transform: capitalize;'>Arbeidskontrakt </font></td></tr></table>
	<table class='imagetable' border='0' cellpadding='5' >
		<tr>
			<th><b>Ansettelsesdato</b></th>
			<th><b>Oppsigelsesdato</b></th>
			
			
		</tr>";
$varsel='';
$varsel2='';
$varsel3='';

$i=0;
while ($i < $num) {
	$fra=mysql_result($result,$i,"ansettelsesdato");
	$til=mysql_result($result,$i,"oppsigelsesdato");
	$nyfra = date('d-M-Y', strtotime($fra));
	$nytil = date('d-M-Y', strtotime($til));
	
	
	
	$time = strtotime( $til );
	$dagsdato = date('Y-m-d');
	$dagstime = strtotime( $dagsdato );
	$differanse = $time - $dagstime;
	$utlop = round($differanse / 86400);
	if($utlop <= 31 && $utlop >=0)
	{$varsel='red'; 
	$varsel2='a';
	$varsel3='b';
	}else{$varsel='';
	$varsel2='';
	$varsel3='';}
	
	
++$i;


echo "
	<tr class='$varsel'>
		<td>$nyfra</td>
		<td>$nytil</td>
		
		
	</tr>
	";
} //Slutt på While-løkke
echo "</table>


	<form action='lagrekontrakt.php?avloserid=".$avloserid."&sjekk=nei' method='post'>
	
	
	<table class='imagetable' border='0' cellpadding='5' >

	
	</table>
	
	
	";




}else{
	
	echo"


	";
	

}//Slutt på IF-Setning
//Her slutter koden for å hente ut data om kontrakt
//--------------------------------------------------------------------------------------------

// Her begynner koden for å hente ut data om skolegang
$query="SELECT skolenavn, fag, aar FROM skolegang, avloser 
	WHERE skolegang.avloserid=avloser.avloserid 
	AND skolegang.avloserid='$avloserid' 
	ORDER by skolegang.aar DESC";
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num>0){ 
echo "
	
	<table class='capmain' border='0' cellpadding='0' >
	<tr><td><font style='text-transform: capitalize;'>Skole</font></td></tr>
	</table>
	
	<table class='imagetable' border='0' cellpadding='5' >
		<tr>
			<th><b>Aar</b></th>
			<th><b>Fag</b></th>
			<th><b>Skole</b></th>
		</tr>";

$i=0;
while ($i < $num) {
	$aar=mysql_result($result,$i,"aar");
	$fag=mysql_result($result,$i,"fag");
	$skole=mysql_result($result,$i,"skolenavn");
++$i;


echo "
	<tr>
		<td>$aar</td>
		<td>$fag</td>
		<td>$skole</td>
	</tr>";
} //Slutt på While-løkke
echo "</table>";

	
} //Slutt på IF-Setning

//Her slutter koden for å hente ut data om skolegang
//--------------------------------------------------------------------------------------------


$query="SELECT skole, fag, aar 
		FROM fagbrev, avloser 
		WHERE fagbrev.avloserid=avloser.avloserid 
		AND fagbrev.avloserid='$avloserid' 
		ORDER by fagbrev.aar DESC";
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num>0){ 
echo "
	
	<table class='capmain' border='0' cellpadding='0'>
	<tr><td><font style='text-transform: capitalize;'>Fagbrev</font></td></tr>
	</table>
	
	<table class='imagetable' border='0' cellpadding='5'>
		<tr>
			<th><b>&aring;r</b></th>
			<th><b>Fagbrev</b></th>
			<th><b>Skole</b></th>
		</tr>";

$i=0;
while ($i < $num) {
	$aar=mysql_result($result,$i,"aar");
	$fag=mysql_result($result,$i,"fag");
	$skole=mysql_result($result,$i,"skole");
++$i;


echo "
	<tr>
		<td>$aar</td>
		<td>$fag</td>
		<td>$skole</td>
	</tr>";
} //Slutt på While-løkke

echo "

	
	</table>
	
	
	";}


//Her begynner koden for å hente ut data om kurs/sertifikat
$query="SELECT * FROM kurs_sertifikat, avloser  
	WHERE avloser.avloserid=$avloserid
	AND avloser.avloserid=kurs_sertifikat.avloserid 
	ORDER BY aar DESC" ;
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num>0){ 
echo "
	<table class='capmain' border='0' cellpadding='0' >
	<tr><td><font style='text-transform: capitalize;'>Kurs/Sertifikat</font></td></tr></table>
	<table class='imagetable' border='0' cellpadding='5' >
		<tr>
			<th><b>Aar</b></th>
			<th><b>Kurs- Sertifikattype</b></th>
			<th><b>Sted</b></th>
		</tr>";

$i=0;
while ($i < $num) {
	$kaar=mysql_result($result,$i,"aar");
	$ktype=mysql_result($result,$i,"kurstype");
	$ksted=mysql_result($result,$i,"kurssted");
++$i;


echo "
	<tr>
		<td>$kaar</td>
		<td>$ktype</td>
		<td>$ksted</td>
	</tr>
	";
} //Slutt på While-løkke
echo "</table>";

} //Slutt på IF-Setning
//Her slutter koden for å hente ut data om kurs/sertifikat
//--------------------------------------------------------------------------------------------

 
echo" <P CLASS='breakhere'>";
//Her begynner funksjonen for arbeidserfaring
//--------------------------------------------------------------------------------------------

$query="SELECT * FROM arbeidserfaring, avloser  
	WHERE avloser.avloserid=$avloserid
	AND avloser.avloserid=arbeidserfaring.avloserid 
	ORDER BY tildato DESC" ;
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num>0){ 
echo "
	<table class='capmain' border='0' cellpadding='0' >
	<tr><td><font style='text-transform: capitalize;'>Arbeidserfaring</font></td></tr></table>
	<table class='imagetable' border='0' cellpadding='5' >
		<tr>
			<th><b>Fra</b></th>
			<th><b>Til</b></th>
			<th><b>Sted</b></th>
			<th><b>Erfaring</b></th>
		</tr>";

$i=0;
while ($i < $num) {
	$fra=mysql_result($result,$i,"fradato");
	$til=mysql_result($result,$i,"tildato");
	$asted=mysql_result($result,$i,"arbeidssted");
	$erfaring=mysql_result($result,$i,"erfaring");
	$nyfra = date('d-M-Y', strtotime($fra));
	$nytil = date('d-M-Y', strtotime($til));
++$i;


echo "
	<tr>
		<td>$nyfra</td>
		<td>$nytil</td>
		<td>$asted</td>
		<td>$erfaring</td>
	</tr>
	";
} //Slutt på While-løkke
echo "</table>";

	
} //Slutt på IF-Setning
//Her slutter koden for å hente ut data om kurs/sertifikat







$query="SELECT * 
		FROM avlosermote, avloser  
		WHERE avloser.avloserid=$avloserid
		AND avloser.avloserid=avlosermote.avloserid 
		ORDER BY dato DESC" ;
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num>0){ 
echo "
	<table class='capmain' border='0' cellpadding='0'>
	<tr><td><font style='text-transform: capitalize;'>Medarbeidersamtale</font></td></tr></table>
	<table class='imagetable' border='0' cellpadding='5'>
		<tr>
			
			
			<th><b>Dato</b></th>
			<th><b>Info</b></th>
		</tr>";

$i=0;
while ($i < $num) {
	$dato=mysql_result($result,$i,"dato");
	$info=mysql_result($result,$i,"info");

	
	$nydato = date('d-M-Y', strtotime($dato));
	
	$time = strtotime( $dato );
	$dagsdato = date('Y-m-d');
	$dagstime = strtotime( $dagsdato );
	$differanse = $time - $dagstime;
	$utlop = round($differanse / 86400);
	if($utlop <= 31 && $utlop >=0)
	{$varsel='redmote'; 
	$varsel2='amote';
	$varsel3='bmote';
	}else{$varsel='';
	$varsel2='';
	$varsel3='';}
++$i;


echo "
	<tr class='$varsel'>
		
		<td class='$varsel3'>$nydato</td>
		<td class='$varsel3'>$info</td>
		
	</tr>
	";
} //Slutt på While-løkke

echo "

	
	</table>
	
	
	";

}






//--------------------------------------------------------------------------------------------
//Her begynner koden for å hente ut data om førerkort
$query5="SELECT * 
		FROM forerkort
		WHERE forerkort.avloserid=".$avloserid."";
		
		$result5=mysql_query($query5);
		$num5=mysql_numrows($result5);
		
		if($num5>0){
		$fkid=mysql_result($result5,0,"forerkortid");

$query="SELECT oppkjoringklasse.klasse 
		FROM oppkjoringklasse, forerkort
		WHERE oppkjoringklasse.forerkortid=forerkort.forerkortid
		AND forerkort.avloserid=".$avloserid."";
		$result2=mysql_query($query);
		$num2=mysql_numrows($result2);
		
		
$query="SELECT * 
		FROM forerkortklasse, forerkort
		WHERE forerkortklasse.forerkortid=forerkort.forerkortid
		AND forerkort.avloserid=".$avloserid."";
		$result3=mysql_query($query);
		$num3=mysql_numrows($result3);
		
		

			$query="SELECT utgaar 
					FROM forerkort
					WHERE forerkort.avloserid=".$avloserid."";
					$result1=mysql_query($query);
					$num1=mysql_numrows($result1);
			
			
			
			$utgaar=mysql_result($result1,0,"utgaar");
			
			
			echo "<table class='capmain' border='0' cellpadding='0' >
				<tr><td><font style='text-transform: capitalize;'>F&oslash;rerkort</font></td></tr></table>";
			
			echo "<table class='imagetable' border='0' cellpadding='5'>
			<tr>
			<th><b>F&oslash;rerkort klasse:</b></th><td>&nbsp;-&nbsp;";
			
			$i=0;
			while ($i < $num3) {
			$klasse=mysql_result($result3,$i,"klasse");
			echo "$klasse&nbsp;-&nbsp;";
			++$i;	
			}
			
			echo " </td>
			</tr>
			<tr>
			<th><b>Utg&aring;r dato:</b></th><td>&nbsp;-&nbsp;$utgaar&nbsp;-&nbsp;</td>
			</tr>
			<tr>
			<th><b>Oppkj&oslash;rt klasse:</b></th>
			<td>&nbsp;-&nbsp;";
			
			$i=0;
			while ($i < $num2) {
			$oppklasse=mysql_result($result2,$i,"klasse");
			echo "$oppklasse&nbsp;-&nbsp;";
			++$i;	
			}
			
			echo"</td>
			</tr>
			<tr>
			

			
			</table>";}


// Her begynner koden for å hente ut data om egenvurdering
$query="SELECT  egenvurdering_id, egenvurdering.avloserid, sau_foring, sau_sanking, sau_lamming, storfe_foring, 
		storfe_melking, storfe_kalving, gris, fjerfe, traktor_enkel, traktor_allsidig, motorsag, melkerobot, 
		gjerding, fjervask, sau_foring_egen, sau_sanking_egen, sau_lamming_egen, storfe_foring_egen, storfe_melking_egen, 
		storfe_kalving_egen, gris_egen, fjerfe_egen, traktor_enkel_egen, traktor_allsidig_egen, motorsag_egen, melkerobot_egen, gjerding_egen, fjervask_egen
		FROM egenvurdering, avloser
		WHERE egenvurdering.avloserid = avloser.avloserid
		AND egenvurdering.avloserid =$avloserid";
$result=mysql_query($query);
$num=mysql_numrows($result);

if ($num>0){ 
echo "<table class='capmain' border='0' cellpadding='0'>
	<tr><td><font style='text-transform: capitalize;'>Egenvurdering</font></td></tr></table>
	
	<table class='imagetable' table border='0' cellpadding='5' >

";
$i=0;
while ($i < $num) {
	$sau_foring=mysql_result($result,$i,"sau_foring");
	$sau_sanking=mysql_result($result,$i,"sau_sanking");
	$sau_lamming=mysql_result($result,$i,"sau_lamming");
	$storfe_foring=mysql_result($result,$i,"storfe_foring");
	$storfe_melking=mysql_result($result,$i,"storfe_melking");
	$storfe_kalving=mysql_result($result,$i,"storfe_kalving");
	$gris=mysql_result($result,$i,"gris");
	$fjerfe=mysql_result($result,$i,"fjerfe");
	$traktor_enkel=mysql_result($result,$i,"traktor_enkel");
	$traktor_allsidig=mysql_result($result,$i,"traktor_allsidig");
	$motorsag=mysql_result($result,$i,"motorsag");
	$melkerobot=mysql_result($result,$i,"melkerobot");
	$gjerding=mysql_result($result,$i,"gjerding");
	$fjervask=mysql_result($result,$i,"fjervask");
	$sau_foring_egen=mysql_result($result,$i,"sau_foring_egen");
	$sau_sanking_egen=mysql_result($result,$i,"sau_sanking_egen");
	$sau_lamming_egen=mysql_result($result,$i,"sau_lamming_egen");
	$storfe_foring_egen=mysql_result($result,$i,"storfe_foring_egen");
	$storfe_melking_egen=mysql_result($result,$i,"storfe_melking_egen");
	$storfe_kalving_egen=mysql_result($result,$i,"storfe_kalving_egen");
	$gris_egen=mysql_result($result,$i,"gris_egen");
	$fjerfe_egen=mysql_result($result,$i,"fjerfe_egen");
	$traktor_enkel_egen=mysql_result($result,$i,"traktor_enkel_egen");
	$traktor_allsidig_egen=mysql_result($result,$i,"traktor_allsidig_egen");
	$motorsag_egen=mysql_result($result,$i,"motorsag_egen");
	$melkerobot_egen=mysql_result($result,$i,"melkerobot_egen");
	$gjerding_egen=mysql_result($result,$i,"gjerding_egen");
	$fjervask_egen=mysql_result($result,$i,"fjervask_egen");
	$sid=mysql_result($result,$i,"egenvurdering_id");
++$i;
echo "
	<form action='updateform_egenvurdering.php?sid=".$sid."&avloserid=".$avloserid."&slett=ja&sjekk=nei' method='post'>
		<tr>
		<th></th>
		<th>Null</th>
		<th>Litt</th>
		<th>Ok</th>
		<th>Bra</th>
		<th></th>
		<th>Nei Takk</th>
		<th>Helst Ikke</th>
		<th>Ok</th>
		<th>Ja Takk</th>
		<th>&Oslash;nsker &aring; l&aelig;re mer</th>
	</tr>
	<tr>
		<th colspan='11'>Sau: </th>
	</tr>
	<tr>";
//----------------Her begynner SAU-FORING-------------------
echo"	
		<th>Foring </th><td>";
if ($sau_foring == 'Null') {
	echo "<input type='radio' name='sau_foring' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_foring' value='Null' disabled='disabled' />";
}
echo" </td><td>";
if ($sau_foring == 'Litt') {
    echo "<input type='radio' name='sau_foring' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_foring' value='Litt' disabled='disabled' />";
}
echo" </td><td>";
if ($sau_foring == 'Ok') {
echo"    <input type='radio' name='sau_foring' value='Ok' checked='checked' />";
}
else {    
echo" <input type='radio' name='sau_foring' value='Ok' disabled='disabled' />";
}
echo" </td><td>";
if ($sau_foring == 'Bra') {
    echo "<input type='radio' name='sau_foring' value='Bra' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_foring' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($sau_foring_egen == 'Nei Takk') {
    echo "<input type='radio' name='sau_foring_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_foring_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($sau_foring_egen == 'Ok') {
    echo "<input type='radio' name='sau_foring_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_foring_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($sau_foring_egen == 'Helst Ikke') {
    echo "<input type='radio' name='sau_foring_egen' value='Helst Ikke' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_foring_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($sau_foring_egen == 'Ja Takk') {
    echo "<input type='radio' name='sau_foring_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_foring_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";
if ($sau_foring_egen == 'Lere Mer') {
    echo "<input type='radio' name='sau_foring_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_foring_egen' value='Lere Mer' disabled='disabled'/>";
} 

echo"</td></tr>
	       <tr>";
//---------------Her begynner SAU-SANKING------------------------------
echo"		   
<th>Sanking </th><td>";
if ($sau_sanking == 'Null') {
    echo "<input type='radio' name='sau_sanking' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_sanking' value='Null' disabled='disabled'/>";
}
echo" </td><td>";
if ($sau_sanking == 'Litt') {
    echo "<input type='radio' name='sau_sanking' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_sanking' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($sau_sanking == 'Ok') {
    echo "<input type='radio' name='sau_sanking' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_sanking' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($sau_sanking == 'Bra') {
    echo "<input type='radio' name='sau_sanking' value='Bra' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_sanking' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($sau_sanking_egen == 'Nei Takk') {
    echo "<input type='radio' name='sau_sanking_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_sanking_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($sau_sanking_egen == 'Ok') {
    echo "<input type='radio' name='sau_sanking_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_sanking_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($sau_sanking_egen == 'Helst Ikke') {
    echo "<input type='radio' name='sau_sanking_egen' value='Helst Ikke' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_sanking_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($sau_sanking_egen == 'Ja Takk') {
    echo "<input type='radio' name='sau_sanking_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_sanking_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";
if ($sau_sanking_egen == 'Lere Mer') {
    echo "<input type='radio' name='sau_sanking_egen' value='Lere Mer' checked='checked' d/>";
}
else {    
    echo "<input type='radio' name='sau_sanking_egen' value='Lere Mer' disabled='disabled'/>";
} 

echo"</td></tr>
	<tr>";
//-------------------Her begynner SAU-LAMMING-----------------------------
echo"
		<th>Lamming </th><td>";
if ($sau_lamming == 'Null') {
    echo "<input type='radio' name='sau_lamming' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_lamming' value='Null' disabled='disabled'/>";
}
echo" </td><td>";
if ($sau_lamming == 'Litt') {
    echo "<input type='radio' name='sau_lamming' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_lamming' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($sau_lamming == 'Ok') {
    echo "<input type='radio' name='sau_lamming' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_lamming' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($sau_lamming == 'Bra') {
    echo "<input type='radio' name='sau_lamming' value='Bra' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_lamming' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($sau_lamming_egen == 'Nei Takk') {
    echo "<input type='radio' name='sau_lamming_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_lamming_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($sau_lamming_egen == 'Ok') {
    echo "<input type='radio' name='sau_lamming_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_lamming_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($sau_lamming_egen == 'Helst Ikke') {
    echo "<input type='radio' name='sau_lamming_egen' value='Helst Ikke' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_lamming_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($sau_lamming_egen == 'Ja Takk') {
    echo "<input type='radio' name='sau_lamming_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_lamming_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";
if ($sau_lamming_egen == 'Lere Mer') {
    echo "<input type='radio' name='sau_lamming_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='sau_lamming_egen' value='Lere Mer' disabled='disabled'/>";
} 

echo"</td></tr>
	<tr>
		<th colspan='11'>Storfe:</th>
	</tr>
	<tr>";
//----------------------Her begynner STORFE-FORING------------------------
echo"
		<th>Foring </th><td>";
if ($storfe_foring == 'Null') {
    echo "<input type='radio' name='storfe_foring' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_foring' value='Null' disabled='disabled'/>";
}
echo" </td><td>";
if ($storfe_foring == 'Litt') {
    echo "<input type='radio' name='storfe_foring' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_foring' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($storfe_foring == 'Ok') {
    echo "<input type='radio' name='storfe_foring' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_foring' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($storfe_foring == 'Bra') {
    echo "<input type='radio' name='storfe_foring' value='Bra' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_foring' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($storfe_foring_egen == 'Nei Takk') {
    echo "<input type='radio' name='storfe_foring_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_foring_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($storfe_foring_egen == 'Ok') {
    echo "<input type='radio' name='storfe_foring_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_foring_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($storfe_foring_egen == 'Helst Ikke') {
    echo "<input type='radio' name='storfe_foring_egen' value='Helst Ikke' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_foring_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($storfe_foring_egen == 'Ja Takk') {
    echo "<input type='radio' name='storfe_foring_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_foring_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";
if ($storfe_foring_egen == 'Lere Mer') {
    echo "<input type='radio' name='storfe_foring_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_foring_egen' value='Lere Mer' disabled='disabled'/>";
} 

echo"</td></tr>
	<tr>";
//------------------Her begynner STORFE-MELKING--------------------------------
echo"
		<th>Melking </th><td>";
if ($storfe_melking == 'Null') {
    echo "<input type='radio' name='storfe_melking' value='Null' checked='checked'/>";
}
else {    
    echo "<input type='radio' name='storfe_melking' value='Null' disabled='disabled'/>";
}
echo" </td><td>";
if ($storfe_melking == 'Litt') {
    echo "<input type='radio' name='storfe_melking' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_melking' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($storfe_melking == 'Ok') {
    echo "<input type='radio' name='storfe_melking' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_melking' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($storfe_melking == 'Bra') {
    echo "<input type='radio' name='storfe_melking' value='Bra' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_melking' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($storfe_melking_egen == 'Nei Takk') {
    echo "<input type='radio' name='storfe_melking_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_melking_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($storfe_melking_egen == 'Ok') {
    echo "<input type='radio' name='storfe_melking_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_melking_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($storfe_melking_egen == 'Helst Ikke') {
    echo "<input type='radio' name='storfe_melking_egen' value='Helst Ikke' checked='checked' '/>";
}
else {    
    echo "<input type='radio' name='storfe_melking_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($storfe_melking_egen == 'Ja Takk') {
    echo "<input type='radio' name='storfe_melking_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_melking_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";
if ($storfe_melking_egen == 'Lere Mer') {
    echo "<input type='radio' name='storfe_melking_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_melking_egen' value='Lere Mer' disabled='disabled'/>";
} 

echo"</td></tr>";

//---------------------------Her begynner STORFE-MELKEROBOT-----------------------	
echo" 	<tr>
		<th>Melkerobot</th><td>";
if ($melkerobot == 'Null') {
    echo "<input type='radio' name='melkerobot' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='melkerobot' value='Null' disabled='disabled' />";
}
echo" </td><td>";
if ($melkerobot == 'Litt') {
    echo "<input type='radio' name='melkerobot' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='melkerobot' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($melkerobot == 'Ok') {
    echo "<input type='radio' name='melkerobot' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='melkerobot' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($melkerobot == 'Bra') {
    echo "<input type='radio' name='melkerobot' value='Bra' checked='checked' />";
}
else {    
    echo "<input type='radio' name='melkerobot' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($melkerobot_egen == 'Nei Takk') {
    echo "<input type='radio' name='melkerobot_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='melkerobot_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($melkerobot_egen == 'Ok') {
    echo "<input type='radio' name='melkerobot_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='melkerobot_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($melkerobot_egen == 'Helst Ikke') {
    echo "<input type='radio' name='melkerobot_egen' value='Helst Ikke' checked='checked' />";
}
else {    
    echo "<input type='radio' name='melkerobot_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($melkerobot_egen == 'Ja Takk') {
    echo "<input type='radio' name='melkerobot_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='melkerobot_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";
if ($melkerobot_egen == 'Lere Mer') {
    echo "<input type='radio' name='melkerobot_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='melkerobot_egen' value='Lere Mer' disabled='disabled'/>";
} 

echo"</td></tr>
	 <tr>";
//---------------------------Her begynner STORFE-KALVING-----------------------	
echo"
		<th>Kalving </th><td>";
if ($storfe_kalving == 'Null') {
    echo "<input type='radio' name='storfe_kalving' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_kalving' value='Null' disabled='disabled'/>";
}
echo" </td><td>";
if ($storfe_kalving == 'Litt') {
    echo "<input type='radio' name='storfe_kalving' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_kalving' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($storfe_kalving == 'Ok') {
    echo "<input type='radio' name='storfe_kalving' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_kalving' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($storfe_kalving == 'Bra') {
    echo "<input type='radio' name='storfe_kalving' value='Bra' checked='checked'/>";
}
else {    
    echo "<input type='radio' name='storfe_kalving' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($storfe_kalving_egen == 'Nei Takk') {
    echo "<input type='radio' name='storfe_kalving_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_kalving_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($storfe_kalving_egen == 'Ok') {
    echo "<input type='radio' name='storfe_kalving_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_kalving_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($storfe_kalving_egen == 'Helst Ikke') {
    echo "<input type='radio' name='storfe_kalving_egen' value='Helst Ikke' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_kalving_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($storfe_kalving_egen == 'Ja Takk') {
    echo "<input type='radio' name='storfe_kalving_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_kalving_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";

if ($storfe_kalving_egen == 'Lere Mer') {
    echo "<input type='radio' name='storfe_kalving_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='storfe_kalving_egen' value='Lere Mer' disabled='disabled'/>";
} 

echo"</td></tr>
	<tr>";
//------------------------Her begynner GRIS---------------------------------------
echo"
		<th>Gris: </th><td>";
if ($gris == 'Null') {
    echo "<input type='radio' name='gris' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gris' value='Null' disabled='disabled'/>";
}
echo" </td><td>";
if ($gris == 'Litt') {
    echo "<input type='radio' name='gris' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gris' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($gris == 'Ok') {
    echo "<input type='radio' name='gris' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gris' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($gris == 'Bra') {
    echo "<input type='radio' name='gris' value='Bra' checked='checked' '/>";
}
else {    
    echo "<input type='radio' name='gris' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($gris_egen == 'Nei Takk') {
    echo "<input type='radio' name='gris_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gris_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($gris_egen == 'Ok') {
    echo "<input type='radio' name='gris_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gris_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($gris_egen == 'Helst Ikke') {
    echo "<input type='radio' name='gris_egen' value='Helst Ikke' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gris_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($gris_egen == 'Ja Takk') {
    echo "<input type='radio' name='gris_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gris_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";

if ($gris_egen == 'Lere Mer') {
    echo "<input type='radio' name='gris_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gris_egen' value='Lere Mer' disabled='disabled'/>";
} 

echo"</td></tr>
	<tr>";
//-----------------------Her begynner FJERFE---------------------------
echo"
	<tr>
   <th>Fj&aelig;rfe:</th><td>";
if ($fjerfe == 'Null') {
    echo "<input type='radio' name='fjerfe' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjerfe' value='Null' disabled='disabled'/>";
}
echo" </td><td>";

if ($fjerfe == 'Litt') {
    echo "<input type='radio' name='fjerfe' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjerfe' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($fjerfe == 'Ok') {
    echo" <input type='radio' name='fjerfe' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjerfe' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($fjerfe == 'Bra') {
    echo "<input type='radio' name='fjerfe' value='Bra' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjerfe' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($fjerfe_egen == 'Nei Takk') {
    echo "<input type='radio' name='fjerfe_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjerfe_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($fjerfe_egen == 'Ok') {
    echo "<input type='radio' name='fjerfe_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjerfe_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($fjerfe_egen == 'Helst Ikke') {
    echo "<input type='radio' name='fjerfe_egen' value='Helst Ikke' checked='checked'/>";
}
else {    
    echo "<input type='radio' name='fjerfe_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($fjerfe_egen == 'Ja Takk') {
    echo "<input type='radio' name='fjerfe_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjerfe_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";
if ($fjerfe_egen == 'Lere Mer') {
    echo "<input type='radio' name='fjerfe_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjerfe_egen' value='Lere Mer' disabled='disabled'/>";
} 

echo"</td></tr>
	";
//------------------Her begynner TRAKTOR---------------------------
echo"<tr>
		<th colspan='11'>Traktor:</th>
	</tr>
	<tr>
		<th>Enkel</th><td>";
if ($traktor_enkel == 'Null') {
    echo "<input type='radio' name='traktor_enkel' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_enkel' value='Null' disabled='disabled'/>";
}
echo" </td><td>";
if ($traktor_enkel == 'Litt') {
    echo "<input type='radio' name='traktor_enkel' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_enkel' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($traktor_enkel == 'Ok') {
    echo "<input type='radio' name='traktor_enkel' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_enkel' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($traktor_enkel == 'Bra') {
    echo "<input type='radio' name='traktor_enkel' value='Bra' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_enkel' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($traktor_enkel_egen == 'Nei Takk') {
    echo "<input type='radio' name='traktor_enkel_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_enkel_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($traktor_enkel_egen == 'Ok') {
    echo "<input type='radio' name='traktor_enkel_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_enkel_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($traktor_enkel_egen == 'Helst Ikke') {
    echo "<input type='radio' name='traktor_enkel_egen' value='Helst Ikke' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_enkel_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($traktor_enkel_egen == 'Ja Takk') {
    echo "<input type='radio' name='traktor_enkel_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_enkel_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";
if ($traktor_enkel_egen == 'Lere Mer') {
    echo "<input type='radio' name='traktor_enkel_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_enkel_egen' value='Lere Mer' disabled='disabled'";
} 

echo"</td></tr>
		  <tr>
		<th>Allsidig</th><td>";
if ($traktor_allsidig == 'Null') {
    echo "<input type='radio' name='traktor_allsidig' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_allsidig' value='Null' disabled='disabled'/>";
}
echo" </td><td>";
if ($traktor_allsidig == 'Litt') {
    echo "<input type='radio' name='traktor_allsidig' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_allsidig' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($traktor_allsidig == 'Ok') {
    echo "<input type='radio' name='traktor_allsidig' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_allsidig' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($traktor_allsidig == 'Bra') {
    echo "<input type='radio' name='traktor_allsidig' value='Bra' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_allsidig' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($traktor_allsidig_egen == 'Nei Takk') {
    echo "<input type='radio' name='traktor_allsidig_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_allsidig_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($traktor_allsidig_egen == 'Ok') {
    echo "<input type='radio' name='traktor_allsidig_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_allsidig_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($traktor_allsidig_egen == 'Helst Ikke') {
    echo "<input type='radio' name='traktor_allsidig_egen' value='Helst Ikke' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_allsidig_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($traktor_allsidig_egen == 'Ja Takk') {
    echo "<input type='radio' name='traktor_allsidig_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_allsidig_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";
if ($traktor_allsidig_egen == 'Lere Mer') {
    echo "<input type='radio' name='traktor_allsidig_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='traktor_allsidig_egen' value='Lere Mer' disabled='disabled'";
} 

echo"</td></tr>
<tr>
		<th>motorsag:</th><td>";
if ($motorsag == 'Null') {
    echo "<input type='radio' name='motorsag' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='motorsag' value='Null' disabled='disabled'/>";
}
echo" </td><td>";
if ($motorsag == 'Litt') {
    echo "<input type='radio' name='motorsag' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='motorsag' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($motorsag == 'Ok') {
    echo "<input type='radio' name='motorsag' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='motorsag' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($motorsag == 'Bra') {
    echo "<input type='radio' name='motorsag' value='Bra' checked='checked' />";
}
else {    
    echo "<input type='radio' name='motorsag' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($motorsag_egen == 'Nei Takk') {
    echo "<input type='radio' name='motorsag_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='motorsag_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($motorsag_egen == 'Ok') {
    echo "<input type='radio' name='motorsag_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='motorsag_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($motorsag_egen == 'Helst Ikke') {
    echo "<input type='radio' name='motorsag_egen' value='Helst Ikke' checked='checked' />";
}
else {    
    echo "<input type='radio' name='motorsag_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($motorsag_egen == 'Ja Takk') {
    echo "<input type='radio' name='motorsag_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='motorsag_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";
if ($motorsag_egen == 'Lere Mer') {
    echo "<input type='radio' name='motorsag_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='motorsag_egen' value='Lere Mer' disabled='disabled'";
} 

echo"</td></tr>";
//------------------HER-BEGYNNER-GJERDING--------------------------
echo"	<tr>
		<th>Gj&aelig;rding:</th><td>";
if ($gjerding == 'Null') {
    echo "<input type='radio' name='gjerding' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gjerding' value='Null' disabled='disabled'/>";
}
echo" </td><td>";
if ($gjerding == 'Litt') {
    echo "<input type='radio' name='gjerding' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gjerding' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($gjerding == 'Ok') {
    echo "<input type='radio' name='gjerding' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gjerding' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($gjerding == 'Bra') {
    echo "<input type='radio' name='gjerding' value='Bra' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gjerding' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($gjerding_egen == 'Nei Takk') {
    echo "<input type='radio' name='gjerding_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gjerding_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($gjerding_egen == 'Ok') {
    echo "<input type='radio' name='gjerding_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gjerding_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($gjerding_egen == 'Helst Ikke') {
    echo "<input type='radio' name='gjerding_egen' value='Helst Ikke' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gjerding_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($gjerding_egen == 'Ja Takk') {
    echo "<input type='radio' name='gjerding_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gjerding_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";
if ($gjerding_egen == 'Lere Mer') {
    echo "<input type='radio' name='gjerding_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='gjerding_egen' value='Lere Mer' disabled='disabled'";
} 

echo"</td></tr>";
//------------------HER-BEGYNNER-FJERVASK--------------------------
echo"		  <tr>
		<th>Fj&oslash;rvask:</th><td>";
if ($fjervask == 'Null') {
    echo "<input type='radio' name='fjervask' value='Null' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjervask' value='Null' disabled='disabled'/>";
}
echo" </td><td>";
if ($fjervask == 'Litt') {
    echo "<input type='radio' name='fjervask' value='Litt' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjervask' value='Litt' disabled='disabled'/>";
}
echo" </td><td>";
if ($fjervask == 'Ok') {
    echo "<input type='radio' name='fjervask' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjervask' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";
if ($fjervask == 'Bra') {
    echo "<input type='radio' name='fjervask' value='Bra' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjervask' value='Bra' disabled='disabled'/>";
} 

echo"	</td>
		<th></th>				
		<td>";
if ($fjervask_egen == 'Nei Takk') {
    echo "<input type='radio' name='fjervask_egen' value='Nei Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjervask_egen' value='Nei Takk' disabled='disabled'/>";
}
echo" </td><td>";

if ($fjervask_egen == 'Ok') {
    echo "<input type='radio' name='fjervask_egen' value='Ok' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjervask_egen' value='Ok' disabled='disabled'/>";
}
echo" </td><td>";

if ($fjervask_egen == 'Helst Ikke') {
    echo "<input type='radio' name='fjervask_egen' value='Helst Ikke' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjervask_egen' value='Helst Ikke' disabled='disabled'/>";
}
echo" </td><td>";
if ($fjervask_egen == 'Ja Takk') {
    echo "<input type='radio' name='fjervask_egen' value='Ja Takk' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjervask_egen' value='Ja Takk' disabled='disabled'/>";
} 
echo" </td><td>";
if ($fjervask_egen == 'Lere Mer') {
    echo "<input type='radio' name='fjervask_egen' value='Lere Mer' checked='checked' />";
}
else {    
    echo "<input type='radio' name='fjervask_egen' value='Lere Mer' disabled='disabled'";
} 

echo"</td></tr>
";
} //Slutt på While-løkke

echo "</table>";
echo "

	
	
	
	";
}
//Her slutter koden for å hente ut data om egenvurdering


$query=" SELECT * 
FROM kommentar 
WHERE kommentar.kommentarid=$avloserid";

$result=mysql_query($query);
$num=mysql_numrows($result);


$i=0;
while ($i < $num) {
$kommentar=mysql_result($result,$i,"kommentar");
$kommentarid=mysql_result($result,$i,"kommentarid");
++$i;

echo "
	<table class='capmain' border='0' cellpadding='0' >
	<tr><td><font style='text-transform: capitalize;'>Kommentar</font></td></tr></table>";

echo "<table class='imagetable' border='0' cellpadding='5' >
<form action='oppdaterkommentar.php?avloserid=$avloserid&sjekk=nei' method='post'>
<tr>
<td><textarea style='resize: none' rows='4' cols='76' name='kommentar' wrap='hard'>$kommentar</textarea></td>
</tr>
";
}


echo "</body>\n</html>\n";
?>
